<?php
namespace app\appoint\controller;
use app\AdminRest;
use think\App;
use app\appoint\model\AdminRecord as record_model;
class AdminRecord extends AdminRest
{

    protected $model;
    public function __construct(App $app) {
        parent::__construct($app);
        $this->model      = new record_model();
    }

    /**
     * 预约记录列表
     */
    public function recordList(){
        $input = $this->_param;
        $dis[] = ['a.uniacid','=',$this->_uniacid];
        if(!empty($input['name'])){
            $dis[] = ['a.name','like',"%".'\\'.$input['name']."%"];
        }
        if(!empty($input['project_name'])){
            $dis[] = ['b.title','like',"%".'\\'.$input['project_name']."%"];
//            $dis[] = ['b.status','>',-1];
        }
        if(!empty($input['status'])&&$input['status']!=-1||$input['status']==='0'){
            $dis[] = ['a.status','=',$input['status']];
        }

        $data = $this->model->recordList($dis,$input['limit']);
        return $this->success($data);
    }








}
